from netCDF4 import Dataset
from wrf import getvar
import numpy as np
import csv
import os

# This function extracts the snapshots
#---------------------------------------------------------------------------------------
def Extract_CSV_Data (Dir, csv_file, List, Variable_Name):
	os.chdir(Dir)
	with open(csv_file) as f:
		reader = csv.reader(f)
		row_header = next(reader)
		#print (row_header)
		for row in reader:
			try:
				#print (float(row[row_header.index(Variable_Name)]))
				List.append(float(row[row_header.index(Variable_Name)]) )
			except (ValueError):
				break
